﻿using System.Configuration;

namespace UFIDA.U9.WSS.ProxyService.AccessProxy.Configuration
{
    public sealed class GroupSection : ConfigurationElement
    {
        private ConfigurationPropertyCollection _properties;

        [ConfigurationProperty("name", DefaultValue = "", Options = ConfigurationPropertyOptions.IsRequired)]
        public string Name
        {
            get { return this["name"] != null ? this["name"] as string : ""; }
        }

        [ConfigurationProperty("", DefaultValue = null, Options = ConfigurationPropertyOptions.IsDefaultCollection)]
        public ProxySectionCollection Proxys
        {
            get { return (ProxySectionCollection) base[""]; }
        }

        protected override ConfigurationPropertyCollection Properties
        {
            get
            {
                if (_properties != null) return _properties;
                _properties = new ConfigurationPropertyCollection();
                _properties.Add(new ConfigurationProperty("name", typeof(string), null, null, null,
                    ConfigurationPropertyOptions.None));
                _properties.Add(new ConfigurationProperty("", typeof(ProxySectionCollection), null, null, null,
                    ConfigurationPropertyOptions.IsDefaultCollection));
                return _properties;
            }
        }
    }
}